package com.wanmait.happyheating.controller;

import com.wanmait.happyheating.pojo.Userinfo;
import com.wanmait.happyheating.service.UserinfoService;
import com.wanmait.happyheating.util.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@RestController//指定他是一个控制器的controller注解，每个方法默认加上注解@ResponseBody
@RequestMapping("/manage")
public class UserSafeIDcardController
{

    @Resource//
    private UserinfoService userinfoService;//链接什么数据库就写什么Service
    @PostMapping("updateidcard")//请求方式
    public Result findsafeidcard(Integer id, @RequestBody Userinfo userinfo)//@RequsetBody注解 接收对象
    {
        userinfoService.updateById(userinfo);
        return Result.success(userinfo);
    }
}
